﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Project_mfa.Index" %>

<asp:Content ID="indexHead" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function festSelected(source, eventArgs) {
            var hdnFestId = "<%= hdnFestValue.ClientID %>";

            document.getElementById(hdnFestId).value = eventArgs.get_value();
            __doPostBack(hdnFestId, "");
        }

        function bandSelected(source, eventArgs) {
            var hdnBandId = "<%= hdnBandValue.ClientID %>";

            document.getElementById(hdnBandId).value = eventArgs.get_value();
            __doPostBack(hdnBandId, "");
        }

        $(document).ready(function () {
            var festClicked = false;
            var bandClicked = false;
            $("#<%= festival.ClientID %>").click(function () {
                if (festClicked == false) {
                    $("#<%= festival.ClientID %>").val('');
                    festClicked = true;
                }
            });

            $("#<%= band.ClientID %>").click(function () {
                if (bandClicked == false) {
                    $("#<%= band.ClientID %>").val('');
                    bandClicked = true;
                }
            });

            $(".hide").hide();
            var myBoolean = new Boolean();

            $(".fakeLink").click(function () {
                if (myBoolean) {
                    $(".hide").show(500);
                    myBoolean = false;
                } else {
                    $(".hide").hide(500);
                    myBoolean = true;
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="indexBody" ContentPlaceHolderID="cphContent" runat="server">
        <asp:Panel ID="searchPanel" runat="server">
            <div id="mainForm">
                <ajaxToolkit:ToolkitScriptManager ID="tsm1" runat="server" />
                <asp:Panel ID="festPanel" runat="server" CssClass="row">
                    <div class="col col_16 mainZoek">
                        <div id="festForm">
                            <asp:HiddenField ID="hdnFestValue" OnValueChanged="hdnFestValue_ValueChanged" runat="server" />
                            <asp:TextBox ID="festival" Width="820px" runat="server" Text="Search festival" CssClass="festival"></asp:TextBox>
                            <ajaxToolkit:AutoCompleteExtender OnClientItemSelected="festSelected" CompletionListItemCssClass="compResult" ServiceMethod="compFest" ID="ace1" TargetControlID="festival" runat="server" UseContextKey="True" CompletionInterval="500" />
                        </div>
                    </div>
                </asp:Panel>
                <asp:Panel ID="bandPanel" runat="server" CssClass="row">
                    <div class="col col_16 seachBand">
                        <div id="bandForm">
                            <asp:HiddenField ID="hdnBandValue" OnValueChanged="hdnBandValue_ValueChanged" runat="server" />
                            <asp:TextBox ID="band" Width="820px" runat="server" Text="Search performer/band" CssClass="band"></asp:TextBox>
                            <ajaxToolkit:AutoCompleteExtender OnClientItemSelected="bandSelected" CompletionListCssClass="compResult" ServiceMethod="compBand" ID="ace2" TargetControlID="band" runat="server" UseContextKey="true" CompletionInterval="500" />
                        </div>
                    </div>
                </asp:Panel>
            </div>
        </asp:Panel>
</asp:Content>
